import request from '@/utils/request'
// 订单-列表
export function getList(data) {
  return request({
    url: 'order/list',
    method: 'get',
    params: data
  })
}
// 订单-增
export function getAdd(data) {
  return request({
    url: 'order/',
    method: 'post',
    data
  })
}
// 订单-删
export function del(ids) {
  return request({
    url: 'order',
    method: 'delete',
    data: ids
  })
}
// 订单-改
export function getUpdate(data) {
  return request({
    url: 'order',
    method: 'put',
    data
  })
}
// 订单-详情
export function getDetail(id) {
  return request({
    url: 'order/' +id,
    method: 'get',
  })
}
// 订单-发货
export function getDetailSend(id) {
  return request({
    url: 'order/send/' +id,
    method: 'get',
  })
}
// 订单-取消
export function getDetailCancel(data) {
  return request({
    url: 'order/cancel',
    method: 'post',
    data
  })
}
// 订单-退款
export function getDetailRefund(data) {
  return request({
    url: 'pay/refund',
    method: 'post',
    data
  })
}
//订单-导出
export function getDetailExport(data) {
  return request({
    url: 'order/export',
    method: 'get',
    params: data,
    responseType: "blob",
  })
}

export default { getAdd, getUpdate, del, getList, getDetail, getDetailSend, getDetailCancel, getDetailRefund, getDetailExport}